import App from './App'
import utils from './utils/utils.js'
import directive from './utils/directive'
import store from '@/store/index.js';
import comButton from './components/comButton.vue';
import pageHead from './components/pageHead.vue';
// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
	...App
})
app.$mount()
// #endif

// #ifdef VUE3
import {
	createSSRApp
} from 'vue'
export function createApp() {
	const app = createSSRApp(App)
	// app.config.globalProperties.$utils = utils
	app.provide('$utils',utils)
	app.component('comButton', comButton).component('pageHead', pageHead)
	// 注册自定义指令
	Object.keys(directive).forEach((key) => {
		app.directive(key, directive[key]);
	});
	app.use(store)
	return {
		app
	}
}
// #endif